package com.tangye.massageshop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tangye.massageshop.enums.CompanyStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_company")
@Alias("company")
public class CompanyEntity extends BaseEntity{
    @TableId(type = IdType.AUTO)
    private Integer companyId;
    @NotBlank
    private String companyName;
    @NotBlank
    private String companyAddress;
    @NotBlank
    private String companyContacts;
    @NotBlank
    private String companyPhone;
    @NotNull
    private Date companyStartDay;
    @NotNull
    private Date companyEndDay;
    private String companyStatus;


    public boolean isNormal(){
        return CompanyStatusEnum.NORMAL.getCode().equals(companyStatus);
    }

}
